home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
tex
/
rtextu10.zip
/
CUT.DOC
next >
Wrap
Text File
|
1993-05-06
|
5KB
|
136 lines
#####
# # # # #####
# # # #
# # # #
# # # #
# # # # #
##### #### #
You can get part of the following documentation by invoking the program with
the switches -v, -h, or -H . See README.TXT for more information.
----------------------------------- -v ------------------------------------
CUT v1.0 -- Remove selected fields from each line of a file
Copr (c) 1992,1993 Richard Breuer. CUT is freeware. No warranties.
This is CUT/2 v1.0 - renamed to CUT (from RUTILS 4).
Author: Richard Breuer
Brunssumstrasse 6
5100 Aachen
(after Jul 1, 1993: 52074 Aachen)
Germany
Europe
Phone: +49/241/85605
Fax: +49/241/8021329
Email: ricki@pool.informatik.rwth-aachen.de (Preferred!)
----------------------------------- -h ------------------------------------
CUT v1.0 -- Remove selected fields from each line of a file
Copr (c) 1992,1993 Richard Breuer. CUT is freeware. No warranties.
Usage:
CUT [-hHnuv*] -c<list> infile.. [{>|>>} outfile]
CUT [-hHnuv*] -f<list> [-d<c>] [-s] infile.. [{>|>>} outfile]
Options:
-c<list> Remove by character position. list is a comma-separated list of
integer field numbers, with an optional - to indicate ranges
-d<c> Set the field delimiter to c. The default is a TAB
-f<list> Remove by field position. Instead of character positions, list
specifies fields separated with a delimiter (default is a TAB)
-h Display this help screen
-H Display another help screen with notes and examples
-i Inverse the meaning of -c and -f. Remove all BUT the given columns
or fields
-s Suppress lines with no delimiter characters
-v Display version info and information about the author
-* Display internal information (for debugging purposes)
----------------------------------- -H ------------------------------------
CUT v1.0 -- Remove selected fields from each line of a file
Copr (c) 1992,1993 Richard Breuer. CUT is freeware. No warranties.
Notes:
CUT reads from stdin if a filename is -. The output is always directed
to stdout. The line lengths are restricted to 255 characters. Longer lines
will be cut. The errorlevel is set to 1 if help has been displayed. It is
set to 255 in case of an error and 0 on normal completion. Output resulting
from multiple input files is appended to stdout. The processing order for
wildcards depends on the order of the directory entries. CUT returns
nonsense for binary files.
Examples:
DIR | CUT -f1 -d' '
Display the directory without filenames. Useful, hey?
DIR | CUT -i -f1 -d' '
Display only the filenames of the directory.
CUT -c1-10,4-5,40,20-29,50- TABLE.DAT > STRIP.DAT
Deletes columns 1..10, 20..29, 40, and 50ff from the file TABLE.DAT and
places the result in STRIP.DAT. Note that the columns need not be sorted,
and that ranges may overlap each other (in the above example 4-5 is a
subrange of 1-10).
-------------------------------------------------------------------------------
Additional information:
CAT is a re-implementation of the Unix command with the same name. It should
behave nearly the same way. A difference is the handling of column or field
lists. This CAT can handle field ranges which overlap each other. Besides,
they don't need to be sorted.
Examples:
Consider the input file FOO.DAT:
>banner.pas 4675 10.02.93 20.52<
>genout.pas 10782 10.02.93 16.09<
>hd.pas 6908 10.02.93 16.09<
>head.pas 3933 10.02.93 16.09<
>nc.pas 8416 10.02.93 16.09<
>nodup.pas 4185 10.02.93 16.09<
>strings2.pas 7384 10.02.93 16.09<
>t.pas 53 8.02.93 12.06<
>tee.pas 4914 10.02.93 16.09<
>upcase.pas 4638 10.02.93 16.09<
>wc.pas 5536 10.02.93 16.09<
CUT -f1 -d' ' FOO.DAT will produce
>4675 10.02.93 20.52<
>10782 10.02.93 16.09<
>6908 10.02.93 16.09<
>3933 10.02.93 16.09<
>8416 10.02.93 16.09<
>4185 10.02.93 16.09<
>7384 10.02.93 16.09<
>53 8.02.93 12.06<
>4914 10.02.93 16.09<
>4638 10.02.93 16.09<
>5536 10.02.93 16.09<
CUT -c1-13 FOO.DAT will produce
> 4675 10.02.93 20.52<
> 10782 10.02.93 16.09<
> 6908 10.02.93 16.09<
> 3933 10.02.93 16.09<
> 8416 10.02.93 16.09<
> 4185 10.02.93 16.09<
> 7384 10.02.93 16.09<
> 53 8.02.93 12.06<
> 4914 10.02.93 16.09<
> 4638 10.02.93 16.09<
> 5536 10.02.93 16.09<
CUT -sf1 -do FOO.DAT will produce
>ut.pas 10782 10.02.93 16.09<
>dup.pas 4185 10.02.93 16.09<
This is so, because (1) these are the only lines containing the
separator 'o' and (2) -s suppresses all lines which do NOT contain this
character.